home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19950329-19950528
/
000034_news@columbia.edu_Sun Apr 2 23:28:11 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-07-31
|
3KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA08780
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Sun, 2 Apr 1995 19:28:23 -0400
Received: by apakabar.cc.columbia.edu id AA26641
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Sun, 2 Apr 1995 19:28:15 -0400
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Capture macro
Date: 2 Apr 1995 23:28:11 GMT
Organization: Columbia University
Lines: 51
Message-Id: <3lnbub$q0d@apakabar.cc.columbia.edu>
References: <796463548snz@childsoc.demon.co.uk>
Nntp-Posting-Host: watsun.cc.columbia.edu
Apparently-To: kermit.misc@watsun.cc.columbia.edu
In article <796463548snz@childsoc.demon.co.uk>,
Michael Bernardi <Mike@childsoc.demon.co.uk> wrote:
>Has anyone written a macro which will capture on screen text, to a file,
>without ESCape sequences. Invoked by pressing a key combination (eg Alt+C)
>you get PROMPTED for a file name, which you can then type. Alternatively
>you can be GIVEN a default name which can be edited.
>
>I'm not even sure if this is possible using MS-Kermit. I think I have
>managed to getthis to work for a default filename. BUT I can't get user
>imput to change this.
>
The screen is dumped to a file using the \Kdump verb. This copies the
on-screen text (without highlighting, colors, etc) to a plain-text file. No
escape sequences. The default file is KERMIT.SCN in the current directory.
If it already exists it is appended to. The \Kdump verb is assigned to
Ctrl-End by default, and you can move it around with SET KEY. The screen-dump
file can be changed with SET DUMP. This is all in the manual.
You want a "hot key" that prompts the user for a filename to save the
screen text to. Well, we can write a macro to do this, and then assign it
to the desired key, along with the \Kdump verb. First let's write the macro.
define getdumpfile echo SCREEN DUMP REQUESTED,-
:loop,-
ask \%9 {File to dump to: },-
if not def \%9 goto loop,-
if exist \%9 goto done,-
open write \%9,-
if success goto ok,-
echo Error: \%9 can't be created,-
goto loop,-
:ok,-
close write,-
delete \%9,-
:done,-
set dump \%9,-
connect
This macro not only prompts for the filename, but also checks whether the
named file can actually be used; if not it goes back and reprompts.
Now to assign the whole process to (say) Alt-C (Alt-Shift-C), do:
set key \2862 {\{Kgetdumpfile}\{Kdump}}
(The arrangement of braces and slashes is a bit mysterious, but is documented
in the KERMIT.BWR file.)
Embellish or simplify as desired.
- Frank